/*   1:    */ package org.intellij.plugins.relaxNG.compact;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.util.Ref;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import gnu.trove.TIntObjectHashMap;
import gnu.trove.TObjectProcedure;
import org.jetbrains.annotations.NotNull;
import org.kohsuke.rngom.parse.compact.CompactSyntaxConstants;

import java.lang.reflect.Field;
import java.util.Locale;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */ 
/*  13:    */ public class RncTokenTypes
/*  14:    */ {
/*  15:    */   private static final TIntObjectHashMap<IElementType> a;
/*  16:    */   
/*  17:    */   static
/*  18:    */   {
/*  19: 36 */     a = new TIntObjectHashMap();
/*  20:    */     
/*  21:    */ 
/*  22: 39 */     assert (RngCompactLanguage.INSTANCE != null);
/*  23:    */     try
/*  24:    */     {
/*  25: 41 */       Field[] arrayOfField = CompactSyntaxConstants.class.getFields();
/*  26: 42 */       for (Object localObject2 : arrayOfField)
/*  27:    */       {
/*  28: 43 */         String str2 = localObject2.getName();
/*  29: 44 */         if (str2.equals("DEFAULT")) {
/*  30:    */           break;
/*  31:    */         }
/*  32: 46 */         if (Integer.TYPE.isAssignableFrom(localObject2.getType()))
/*  33:    */         {
/*  34: 47 */           Integer localInteger = (Integer)localObject2.get(null);
/*  35: 48 */           a.put(localInteger.intValue(), new RncElementType(str2));
/*  36:    */         }
/*  37:    */       }
/*  38: 52 */       ??? = CompactSyntaxConstants.tokenImage;
/*  39: 53 */       for (??? = 0; ??? < ???.length; ???++)
/*  40:    */       {
/*  41: 54 */         String str1 = ???[???];
/*  42: 55 */         if (str1.matches("\"\\w*\"")) {
/*  43: 56 */           str1 = "KEYWORD_" + str1.substring(1, str1.length() - 1).toUpperCase(Locale.US);
/*  44: 57 */         } else if (str1.matches("\".*\"")) {
/*  45: 58 */           str1 = str1.substring(1, str1.length() - 1);
/*  46:    */         }
/*  47: 60 */         if (a.get(???) == null) {
/*  48: 61 */           a.put(???, new RncElementType(str1));
/*  49:    */         }
/*  50:    */       }
/*  51:    */     }
/*  52:    */     catch (IllegalAccessException localIllegalAccessException)
/*  53:    */     {
/*  54: 65 */       throw new Error(localIllegalAccessException);
/*  55:    */     }
/*  56:    */   }
/*  57:    */   
/*  58:    */   @NotNull
/*  59:    */   public static IElementType get(int paramInt)
/*  60:    */   {
/*  61: 71 */     assert (!a.isEmpty());
/*  62: 72 */     IElementType localIElementType = (IElementType)a.get(paramInt);
/*  63: 73 */     assert (localIElementType != null) : ("Unknown token kind: " + paramInt); IElementType 
/*  64: 74 */       tmp72_71 = localIElementType;
/*  65: 74 */     if (tmp72_71 == null) {
/*  66: 74 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncTokenTypes", "get" }));
/*  67:    */     }
/*  68: 74 */     return tmp72_71;
/*  69:    */   }
/*  70:    */   
/*  71:    */   @NotNull
/*  72:    */   private static IElementType a(String paramString)
/*  73:    */   {
/*  74: 79 */     assert (!a.isEmpty());
/*  75: 80 */     final Ref localRef = new Ref();
/*  76: 81 */     a.forEachValue(new TObjectProcedure()
/*  77:    */     {
/*  78:    */       public boolean execute(IElementType paramAnonymousIElementType)
/*  79:    */       {
/*  80: 83 */         if (paramAnonymousIElementType.toString().equals(this.val$name))
/*  81:    */         {
/*  82: 84 */           localRef.set(paramAnonymousIElementType);
/*  83: 85 */           return false;
/*  84:    */         }
/*  85: 87 */         return true;
/*  86:    */       }
/*  87: 90 */     }); IElementType tmp54_51 = ((IElementType)localRef.get());
/*  88: 90 */     if (tmp54_51 == null) {
/*  89: 90 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/intellij/plugins/relaxNG/compact/RncTokenTypes", "get" }));
/*  90:    */     }
/*  91: 90 */     return tmp54_51;
/*  92:    */   }
/*  93:    */   
/*  94: 93 */   private static final IElementType b = get(39);
/*  95: 94 */   public static final TokenSet WHITESPACE = TokenSet.create(new IElementType[] { b });
/*  96: 96 */   public static final IElementType ILLEGAL_CHAR = get(60);
/*  97: 98 */   public static final IElementType LBRACE = a("{");
/*  98: 99 */   public static final IElementType RBRACE = a("}");
/*  99:100 */   public static final IElementType LBRACKET = a("[");
/* 100:101 */   public static final IElementType RBRACKET = a("]");
/* 101:102 */   public static final IElementType LPAREN = a("(");
/* 102:103 */   public static final IElementType RPAREN = a(")");
/* 103:105 */   public static final IElementType GTGT = get(59);
/* 104:107 */   public static final TokenSet BRACES = TokenSet.create(new IElementType[] { LBRACE, RBRACE });
/* 105:109 */   public static final IElementType EQ = a("=");
/* 106:110 */   public static final IElementType PLUS = a("+");
/* 107:111 */   public static final IElementType MINUS = a("-");
/* 108:112 */   public static final IElementType STAR = a("*");
/* 109:113 */   public static final IElementType AND = a("&");
/* 110:114 */   public static final IElementType PIPE = a("|");
/* 111:115 */   public static final IElementType QUEST = a("?");
/* 112:117 */   public static final IElementType PREFIXED_NAME = get(57);
/* 113:118 */   public static final IElementType PREFIXED_STAR = get(56);
/* 114:120 */   public static final IElementType CHOICE_EQ = a("|=");
/* 115:121 */   public static final IElementType INTERLEAVE_EQ = a("&=");
/* 116:123 */   public static final IElementType COMMA = a(",");
/* 117:125 */   public static final TokenSet BINARY_OPS = TokenSet.create(new IElementType[] { COMMA, PIPE, AND });
/* 118:129 */   public static final TokenSet QUANTIFIER_OPS = TokenSet.create(new IElementType[] { PLUS, STAR, QUEST });
/* 119:133 */   public static final IElementType DOC = get(40);
/* 120:134 */   public static final TokenSet DOC_TOKENS = TokenSet.create(new IElementType[] { DOC, get(43), get(41) });
/* 121:140 */   public static final IElementType COMMENT = get(42);
/* 122:141 */   public static final TokenSet COMMENTS = TokenSet.create(new IElementType[] { COMMENT, get(44) });
/* 123:146 */   public static final IElementType ESCAPED_IDENTIFIER = get(55);
/* 124:147 */   public static final TokenSet IDENTIFIERS = TokenSet.create(new IElementType[] { get(54), ESCAPED_IDENTIFIER });
/* 125:152 */   public static final TokenSet OPERATORS = TokenSet.orSet(new TokenSet[] { TokenSet.create(new IElementType[] { CHOICE_EQ, INTERLEAVE_EQ }), BINARY_OPS, QUANTIFIER_OPS });
/* 126:155 */   public static final IElementType LITERAL = get(58);
/* 127:156 */   public static final TokenSet STRINGS = TokenSet.create(new IElementType[] { LITERAL });
/* 128:158 */   static final TokenSet READABLE_TEXT = TokenSet.orSet(new TokenSet[] { DOC_TOKENS, COMMENTS, TokenSet.create(new IElementType[] { LITERAL }) });
/* 129:162 */   public static final IElementType KEYWORD_ElEMENT = a("KEYWORD_ELEMENT");
/* 130:163 */   public static final IElementType KEYWORD_ATTRIBUTE = a("KEYWORD_ATTRIBUTE");
/* 131:164 */   public static final IElementType KEYWORD_NAMESPACE = a("KEYWORD_NAMESPACE");
/* 132:165 */   public static final IElementType KEYWORD_LIST = a("KEYWORD_LIST");
/* 133:166 */   public static final IElementType KEYWORD_MIXED = a("KEYWORD_MIXED");
/* 134:167 */   public static final IElementType KEYWORD_EMPTY = a("KEYWORD_EMPTY");
/* 135:168 */   public static final IElementType KEYWORD_GRAMMAR = a("KEYWORD_GRAMMAR");
/* 136:169 */   public static final IElementType KEYWORD_TEXT = a("KEYWORD_TEXT");
/* 137:170 */   public static final IElementType KEYWORD_PARENT = a("KEYWORD_PARENT");
/* 138:171 */   public static final IElementType KEYWORD_EXTERNAL = a("KEYWORD_EXTERNAL");
/* 139:172 */   public static final IElementType KEYWORD_NOT_ALLOWED = a("KEYWORD_NOTALLOWED");
/* 140:173 */   public static final IElementType KEYWORD_START = a("KEYWORD_START");
/* 141:174 */   public static final IElementType KEYWORD_INCLUDE = a("KEYWORD_INCLUDE");
/* 142:175 */   public static final IElementType KEYWORD_DEFAULT = a("KEYWORD_DEFAULT");
/* 143:176 */   public static final IElementType KEYWORD_INHERIT = a("KEYWORD_INHERIT");
/* 144:177 */   public static final IElementType KEYWORD_STRING = a("KEYWORD_STRING");
/* 145:178 */   public static final IElementType KEYWORD_TOKEN = a("KEYWORD_TOKEN");
/* 146:179 */   public static final IElementType KEYWORD_DATATYPES = a("KEYWORD_DATATYPES");
/* 147:180 */   public static final IElementType KEYWORD_DIV = a("KEYWORD_DIV");
/* 148:182 */   public static final TokenSet KEYWORDS = TokenSet.create(new IElementType[] { KEYWORD_ATTRIBUTE, KEYWORD_DATATYPES, KEYWORD_DEFAULT, KEYWORD_DIV, KEYWORD_ElEMENT, KEYWORD_EMPTY, KEYWORD_EXTERNAL, KEYWORD_GRAMMAR, KEYWORD_INCLUDE, KEYWORD_INHERIT, KEYWORD_LIST, KEYWORD_MIXED, KEYWORD_NAMESPACE, KEYWORD_NOT_ALLOWED, KEYWORD_PARENT, KEYWORD_START, KEYWORD_STRING, KEYWORD_TEXT, KEYWORD_TOKEN });
/* 149:204 */   public static final TokenSet IDENTIFIER_OR_KEYWORD = TokenSet.orSet(new TokenSet[] { KEYWORDS, IDENTIFIERS });
/* 150:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.plugins.relaxNG.compact.RncTokenTypes

 * JD-Core Version:    0.7.0.1

 */